package com.motu.vertx.module.utility.base;

import com.motu.vertx.module.utility.toolset.ErrorWord;
import com.motu.vertx.module.utility.toolset.Tool;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

public class CheckEnum {

    private static final Logger logger = LoggerFactory.getLogger(CheckEnum.class);

    /**
     * 检测枚举类是否编译成功
     * @return true:编译成功 false:编译失败
     */
    public static boolean check() {
        try{
            logger.info("Check ErrorWord success value:{}", ErrorWord.SUCCESS.value);
            logger.info("Check CountryCodeEnum success value:{}", CountryCodeEnum.CN.value);
            logger.info("Check CurrencyEnum success value:{}", CurrencyEnum.CNY.value);
            logger.info("Check LoginTypeEnum success value:{}", LoginTypeEnum.MOTU.value);
            logger.info("Check PayTypeEnum success value:{}", PayTypeEnum.APPLE.value);
            return true;
        }catch (Exception e){
            logger.error("Check Enum Error:{}", Tool.getException(e));
            return false;
        }
    }
}
